define(function (require) {
    var $ = require("jquery");
    var SuperbUtil = require('SuperbUtil');
    var IssueUtil = require('IssueUtil');
    require("datetimepicker")($);
    function initEveryDayIssue() {
        var issueListCondition = {
            status: [7],
            date: date,
            isWeekly: 0,
            tableSelector: '#online_issue_list',
            tpl: null
        };
        IssueUtil.initIssueList(issueListCondition);

        var issueListCondition = {
            status: [6],
            date: date,
            isWeekly: 0,
            tableSelector: '#wait_online_issue_list',
            tpl: null
        };
        IssueUtil.initIssueList(issueListCondition);

        var issueListCondition = {
            status: [5],
            date: date,
            isWeekly: 0,
            tableSelector: '#test_issue_list',
            tpl: null
        };
        IssueUtil.initIssueList(issueListCondition);

        var issueListCondition = {
            status: [4],
            date: date,
            isWeekly: 0,
            tableSelector: '#develop_issue_list',
            tpl: null
        };
        IssueUtil.initIssueList(issueListCondition);

        var issueListCondition = {
            status: [3],
            date: date,
            isWeekly: 0,
            tableSelector: '#wait_develop_issue_list',
            tpl: IssueUtil.requirementIssueListTpl
        };
        IssueUtil.initIssueList(issueListCondition);

        var issueListCondition = {
            status: [1],
            date: date,
            isWeekly: 0,
            tableSelector: '#requirement_issue_list',
            tpl: IssueUtil.requirementIssueListTpl
        };
        IssueUtil.initIssueList(issueListCondition);
    }

    SuperbUtil.initUniform();
    // handles main menu
    SuperbUtil.handleSidebarMenu();
    // handles sidebar hide/show
    SuperbUtil.handleSidebarToggler();
    //handles scroll to top functionality in the footer
    SuperbUtil.handleGoTop();

    initEveryDayIssue();
    IssueUtil.getIssueStatus();
    IssueUtil.getPeople();
    IssueUtil.getBranch();
    IssueUtil.getOnDuty();
    IssueUtil.getProject();
    IssueUtil.getIssueType();
    IssueUtil.bindAddIssueButtonEvent();
    IssueUtil.bindAddIssueWindowCloseEvent();
    IssueUtil.bindSaveIssueButtonEvent(function () {
        initEveryDayIssue();
    });
    IssueUtil.bindIssueEditButtonEvent();
    IssueUtil.bindIssueDeleteButtonEvent();
});
